package cn.darkhorse.workflow.core;

import cn.darkhorse.workflow.auto.entity.ConfirmApproval;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * 审批接口
 * @author yuanjun
 * @since 2020/7/20 14:42
 */
public interface IApproval<T> {

    /**
     * 开始一个审批
     * @param iService mybatis-plus生成的服务接口
     * @param businessId 业务表单id
     * @param businessName 业务表单名称
     * @param userName 审批人
     * @param workflowId 工作流id
     * @param workflowType 工作流类型
     * @return
     */
    void startApproval(IService iService, String businessId, String businessName, String workflowId, WorkflowType workflowType, String userName);

    /**
     * 执行审批
     * @param confirmApproval 审批意见封装对象
     * @param workflowType 工作流类型，对应bpmn_type表中的id
     * @return
     */
    void doApproval(IService iService,ConfirmApproval confirmApproval,WorkflowType workflowType,IOpinion opinion);
    
}
